package com.pig4cloud.pigx.user.api.feign;


import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author lengleng
 * @date 2018/6/22
 */
@FeignClient(contextId = "duckweedUserRemoteGatewayService", value = ServiceNameConstants.GATEWAY_SERVICE, path = "/auth")
public interface DuckweedRemoteGatewayService {

    /**
     * 用户登录
     *
     * @param header
     * @param param
     * @param from
     * @return
     */
    @PostMapping(SecurityConstants.OAUTH_TOKEN_URL)
    Map<String, Object> sendGateWay(@RequestHeader HttpHeaders header, @RequestParam Map<String, Object> param, @RequestHeader(SecurityConstants.FROM) String from);
}
